#include "type.h"
#include "ipmi.h"
#define LIBRARY_PATH	"./commands/netfn_0x%02x_cmd_0x%02x.so"

typedef struct {
    uint8 privilege;
    uint8 channel;
    uint16 (*command_entrance)(uint8* request_data, uint16 request_data_size, uint8* response_data);
} cmd_assigments_t;

typedef void (*init_command_f)(cmd_assigments_t* cmd_assigments);

typedef struct {
    void* enable;
    init_command_f init_command;
    cmd_assigments_t cmd_assigments;
} table_cmd_t;

typedef struct {
    uint8 netfn;
    table_cmd_t cmds[COMMAND_NUMBERS];
} table_netfn_t;

void init_command();
void get_command(uint8 netfn, uint8 cmd, uint8* pcmd);
void show_command_info();
int8 enable_command(uint8 netfn, uint8 cmd);
int8 disable_command(uint8 netfn, uint8 cmd);

